prefix = @prefix@
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datarootdir = @datarootdir@
sdlappdatadir = $(datarootdir)/logstalgia/
sdlappfontdir = @sdlappfontdir@

CXX = g++
CC = gcc
objects = sdlapp.o display.o extensions.o fxfont.o logger.o regex.o resource.o stringhash.o texture.o frustum.o camera.o plane.o quadtree.o seeklog.o
CPPFLAGS = @CPPFLAGS@
CXXFLAGS = @CXXFLAGS@

ifdef sdlappdatadir
CPPFLAGS += -DSDLAPP_RESOURCE_DIR=\"$(sdlappdatadir)\"
endif

ifdef sdlappfontdir
CPPFLAGS += -DSDLAPP_FONT_DIR=\"$(sdlappfontdir)/\"
endif

all:	$(objects)

distclean:
	rm Makefile

clean:
	rm -f *.o *.d

%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

ifndef NODEPS
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
dfiles = $(patsubst %.o,%.d,$(objects))
%.d: %.cpp
	$(CXX) $(CXXFLAGS) $< -o $@ -MT $(patsubst %.cpp,%.o,$<) -MM $(CPPFLAGS)
-include $(dfiles)
endif
endif # NODEPS
